<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="jquery-3.5.1.js"></script>
</head>
<body>
    <button onclick="getSchool()">button</button>
</body>
<script>
    function getSchool() {
        $.ajax({
            url:"school.php" ,
            type:"GET",
            data:{
                type: "read"
            },
            success:function (data) {
                console.log(JSON.parse(data));
            },error:function () {
                alert(2)
            }
        });
    }
</script>
</html>